<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let num =100
        let num1=0
        let num2=0
        while (true) {
            let str=+prompt(`请输入你的操作：
        1.存钱
        2.取钱
        3.查看余额
        4.退出功能
        `)     
        if(str===4){
            break
        }
            switch (str) {
                case 1:
                    num1=+prompt("存多少钱")
                    num+=num1
                    break;
                case 2:
                    num2=+prompt("取多少钱")
                    num=num-num2
                    break;
                case 3:
                    alert(num)                   
                    break;
        }
            }
    </script>
</body>
</html>